User-Agent: Microsoft-Entourage/9.0.2509
Date: Mon, 18 Jun 2001 10:21:10 -0400
Subject: Re: Question re: site organization
From: Peter D Bethke <pdbethke@lassosmart.com>
To: <corraltalk@corralmethod.org>
Message-ID: <B7538696.161F7%pdbethke@lassosmart.com>
In-Reply-To: <B7536242.424D%charley@tiggs.net>
Mime-version: 1.0
Content-type: text/plain; charset="US-ASCII"
Content-transfer-encoding: 7bit

Charley,

One thing I didn't mention was the cool way that Corral lets you override
even the most basic variables. Say you are working on a page within the
sales directory, and you created your location-dependent conditional:

[if: (var: 'myfoldername', encodenone) == 'sales']
    [var_set: 'date_shift' = '3']
[else: if: (var: 'mayfoldername', encodenone) == 'marketing']
    [var_set: 'date_shift' = '2']
[else]
    [var_set: 'date_shift' = '1']
[/if]

Then, for some reason, you wanted just one of the pages in the sales
directory to have the marketing date_shift. Simple, you override the
variable 'myfoldername' in the stub file. It thinks it is in marketing, but
it isn't.

So the stub file located at /sales/myfile.lasso

has the variable override:

[var_set: 'myfoldername' = 'marketing']

And now it has the marketing shift. To switch it back, simply comment out
the override.

Also, kinda neat too, is if you are masking information on the page based on
one single user IP address (or maybe a cookie or something) you could be
really funky and say in the stub:

[if: (client_ip) == '192.168.1.100']
    [var_set: 'date_shift' = '4']
[else]
    [var_set: 'date_shift' = '3']
[/if]

Then the guy using that IP has the date shift, and everyone else doesn't.
you might even be able to accommodate time zone changes that way if you have
a static list of IP address ranges from various areas of the country
accessing your site.


Peter

> From: Charley Tiggs <charley@tiggs.net>
> Reply-To: corraltalk@corralmethod.org
> Date: Mon, 18 Jun 2001 07:46:10 -0400
> To: Multiple recipients of CorralTalk <corraltalk@corralmethod.org>
> Subject: Re: Question re: site organization
> 
> Doh!  You answered my first question in your original answer to me.  Sorry.
> I worked too much this weekend.  sigh...
> 
> Charley
> ===========================================
> Charley L. Tiggs | charley@tiggs.net
> ===========================================
> Great spirits have always found violent
> opposition from mediocrities.
> -Albert Einstein
> 
>> From: Charley Tiggs <charley@tiggs.net>
>> Reply-To: corraltalk@corralmethod.org
>> Date: Sun, 17 Jun 2001 21:56:54 -0400
>> To: Multiple recipients of CorralTalk <corraltalk@corralmethod.org>
>> Subject: Re: Question re: site organization
>> 
>> Peter,
>> 
>> Thanks for your helpful answer.  And thanks for explaining why you use the
>> .lasso extension for what I recognized as include pages.  I switched to the
>> .inc extension to help me distinguish between "display" pages and pages that
>> are meant to be included in display pages.  Any file in the includes folder
>> are meant solely for global or sectional includes, regardless of extension.
>> Templates are given .lasso extensions for easy recognizability.
>> 
>> Like all good answers, it led me to more questions. :)  The site_config.inc
>> file.  Under the sections that I outlined previously, many areas in each of
>> those sections use dates based on a pre-defined or requested fiscal year.
>> What I have done is to have the pre-defined or requested year and it's
>> related variables calculated within the site_config.inc file, irregardless
>> of where the user is within the site.  It is a rather lengthy piece of code,
>> however, I couldn't figure out how to break it down within the Corral
>> structure so that it is called when it needs to be called within the
>> specific pages necessary.  With the site_config.inc file, how would you
>> break this out so that it becomes conditional yet maintains the potential
>> for being accessed anywhere within the site?  Would you include the relevant
>> code in each relevant template and insert a variable within the stub file
>> that causes it to run?  Or would you somehow set up a variable within the
>> site_config.inc file above the relevant code that acts like a trigger when
>> needed?
>> 
>> The other question is the fact that I use the [search_args] method for
>> setting passed form_params to variables.  Is this something that lives
>> within the site_config.inc file or elsewhere?
>> 
>> Charley
>> ===========================================
>> Charley L. Tiggs | charley@tiggs.net
>> ===========================================
>> Great spirits have always found violent
>> opposition from mediocrities.
>> -Albert Einstein
>> 
>>> One of the real advantages of Corral is to use location-based variables
>>> declared in the siteconfig file, and to use a subroutine like the one
>>> described in the white paper that creates the variable "myfoldername".
>>> "myfoldername" is a variable that is parsed from the current url, and since
>>> it is usually one of the first variables declared, it can be used by
>>> variables that are set after it in the siteconfig. for example, if you
>>> wanted all pages that are placed in the "sales" directory to have green
>>> tables in it automatically, and all others to have red, you would put this
>>> kind of variable in the siteconfig _after_ the "myfoldername" variable:
>>> 
>>> [if: (var: 'myfoldername', encodenone) == 'sales']
>>> [var_set: 'tablecolor' = 'green']
>>> [else]
>>> [var_set: 'tablecolor' = 'red']
>>> [/if]
>>> 
>>> And in the master template, you have your table cell:
>>> 
>>> <tr><td bgcolor="[var: 'tablecolor']">....</td></tr>
>>> 
>>> The cool thing about using stub files (and why I prefer them over the "one
>>> file fits all approach"), is that say I wanted to override the table color
>>> for one specific page out of all the others in the sales directory, and make
>>> it purple instead. I simply insert the override variable in the stub file:
>>> 
>>> [var_set: 'tablecolor' = 'purple']
>> 
>> 
>> -----------------------------------------------------------------------
>> This is the CorralTalk Mailing List, dedicated to the development of the
>> Corral Methodology (tm), a method for creating dynamic, modular web sites
>> using LDML and the Lasso Database Engine from Blueworld, Inc.
>> 
>> To Subscribe: <mailto:corraltalksubscribe@corralmethod.org>
>> To Unsubscribe: <mailto:corraltalkunsubscribe@corralmethod.org>
>> Official Corral Methodology Website : <http://www.corralmethod.org/>
>> Note: the term "Corral Methodology" is a trademark of Lassosmart.com and
>> Spring Hollow Publishing, Inc.
>> 
>> List hosting graciously provided by <http://www.pointinspace.com/>
>> 
>> ------------------------------------------------------------
>> Lasso Summit 2001: August 10-11, 2001, Orlando, FL
>> Register Now! <http://www.LassoSummit.com/>
>> ------------------------------------------------------------
>> 
>> 
> 
> 
> -----------------------------------------------------------------------
> This is the CorralTalk Mailing List, dedicated to the development of the
> Corral Methodology (tm), a method for creating dynamic, modular web sites
> using LDML and the Lasso Database Engine from Blueworld, Inc.
> 
> To Subscribe: <mailto:corraltalksubscribe@corralmethod.org>
> To Unsubscribe: <mailto:corraltalkunsubscribe@corralmethod.org>
> Official Corral Methodology Website : <http://www.corralmethod.org/>
> Note: the term "Corral Methodology" is a trademark of Lassosmart.com and
> Spring Hollow Publishing, Inc.
> 
> List hosting graciously provided by <http://www.pointinspace.com/>
> 
> ------------------------------------------------------------
> Lasso Summit 2001: August 10-11, 2001, Orlando, FL
> Register Now! <http://www.LassoSummit.com/>
> ------------------------------------------------------------
> 
> 

